package com.xucy.springboot.designmodel.structural.composite;

/**
 * @Author xucy
 * @Date 2019-07-19 13:47
 * @Description 课程组件
 **/

public abstract class CourseComponent {



    public void add(CourseComponent courseComponent){
        throw new RuntimeException(courseComponent+"不允许添加");
    }

    public void remove(CourseComponent courseComponent){
        throw new RuntimeException(courseComponent+"不允许删除");
    }

    public String  getName(CourseComponent courseComponent){
        throw new RuntimeException(courseComponent+"不允许获得名字");
    }

    public double getPrice(CourseComponent courseComponent){
        throw new RuntimeException(courseComponent+"不允许获得价格");
    }

    public void print(){
        System.out.println("111");
    }
}
